<%-- 
    Document   : editVehicleBooking
    Created on : May 13, 2009, 12:26:03 AM
    Author     : Viet Bui
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<c:set var="title" value="Edit Vehicle Booking" scope="page"/>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${title}</title>
    </head>
    <body>
        <h1>${title}</h1>
        <f:view>
            <!-- Show error messages -->
            <h:form id="frmNotification">
                <h:inputHidden id="hdnGeneralVehicleBookingErrorNotification" ></h:inputHidden>
                <h:message showSummary="true" showDetail="true" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="hdnGeneralVehicleBookingErrorNotification"/>
            </h:form>

            <h:form id="vehicleBooking">
                <h:inputHidden value="#{VehicleBookingJSFManagedBean.vehicleBooking.id}" required="true" id="id"/>
                <table>
                    <tr>
                        <td class="label">Customer name: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.customerName}" required="true" id="customerName"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="customerName"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Contact name: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.contactName}" required="true" id="contactName"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="contactName"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Contact phone: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.contactPhone}" required="true" id="contactPhone"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="contactPhone"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Contact email: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.contactEmail}" required="true" id="contactEmail"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="contactEmail"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Pick up date: </td>
                        <td class="required">*</td>
                        <td>
                            <h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.pickUpDate}" required="true" id="pickUpDate">
                                <f:convertDateTime pattern="dd/MM/yyyy" />
                            </h:inputText>
                        </td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="pickUpDate"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Pick up address: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.pickUpAddress}" required="true" id="pickUpAddress"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="pickUpAddress"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Drop off address: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.dropOffAddress}" required="true" id="dropOffAddress"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="dropOffAddress"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Booking type: </td
                        <td class="required">*</td>
                        <td>
                            <h:selectOneMenu value="#{VehicleBookingJSFManagedBean.vehicleBooking.bookingType.id}" required="true" id="bookingTypeId">
                                <f:selectItems value="#{VehicleBookingJSFManagedBean.bookingTypes}" />
                            </h:selectOneMenu>
                        </td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="bookingTypeId"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Event type: </td
                        <td class="required">*</td>
                        <td>
                            <h:selectOneMenu value="#{VehicleBookingJSFManagedBean.vehicleBooking.eventType.id}" required="true" id="eventTypeId">
                                <f:selectItems value="#{VehicleBookingJSFManagedBean.eventTypes}" />
                            </h:selectOneMenu>
                        </td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="eventTypeId"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Vehicle type: </td
                        <td class="required">*</td>
                        <td>
                            <h:selectOneMenu value="#{VehicleBookingJSFManagedBean.vehicleBooking.vehicleType.id}" required="true" id="vehicleTypeId">
                                <f:selectItems value="#{VehicleBookingJSFManagedBean.vehicleTypes}" />
                            </h:selectOneMenu>
                        </td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="vehicleTypeId"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Special requirement: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleBookingJSFManagedBean.vehicleBooking.specialRequirement}" required="true" id="specialRequirement"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="specialRequirement"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Comments: </td>
                        <td class="required">*</td>
                        <td><h:inputTextarea cols="30" rows="3" value="#{VehicleBookingJSFManagedBean.vehicleBooking.comment}" required="true" id="comment"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="comment"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                        <td><h:commandButton id="submit" value="Submit" action="#{VehicleBookingJSFManagedBean.saveVehicleBooking}"/></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </h:form>
        </f:view>
    </body>
</html>